<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<style>
    #topUlLink li{
        list-style: none;
        height: 60px;
        text-align: center;
        line-height: 60px;
        color: #FFF;
        margin: 0 10px;
        font-size: 15px;
        font-family: 微软雅黑;
        border-radius: 6px;
        cursor: pointer;
    }
</style>

<div id="page-content">

    <div class="row" style="margin-bottom:20px;">
        <div class="col-lg-6 col-sm-6 col-xs-12" id="notice_list" style="padding-right:25px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">公告通知</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <%--<a id="notice_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>--%>
                    </div>

                </div>
                <div class="panel-body" id="notice_list_row">
                    <table id="notice_table">
                    </table>
                </div>
            </div>
            <%--<div class="panel">--%>
                <%--<div class="panel-heading">--%>
                    <%--<h3 class="panel-title">个人待办事宜</h3>--%>
                    <%--<div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">--%>
                        <%--<a id="todo_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="panel-body" id="todo_list_row">--%>
                    <%--<table id="todo_table">--%>
                    <%--</table>--%>
                <%--</div>--%>
            <%--</div>--%>
        </div>

        <div class="col-lg-6 col-sm-6 col-xs-12" id="remind_list" style="padding-left:25px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">个人提醒</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="remind_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body"  id="remind_list_row">
                    <table id="remind_table" >
                    </table>
                </div>
            </div>
        </div>
    </div>

    <hr style="height:1px;border-top:1px solid #ccc;"/>

    <%--<div class="row" style="margin-bottom:20px;">--%>
        <%--<div class="col-lg-6 col-sm-6 col-xs-12" id="calendar" style="padding-right:25px">--%>
            <%--<div class="panel">--%>
                <%--<div class="panel-heading">--%>
                    <%--<h3 class="panel-title">日历</h3>--%>
                <%--</div>--%>
                <%--<div id='calendarBody' class="ui-jqgrid ui-corner-all">--%>

                <%--</div>--%>
            <%--</div>--%>
        <%--</div>--%>

        <%--<div class="col-lg-6 col-sm-6 col-xs-12" id="quickLink" style="padding-left:25px">--%>
            <%--<div class="panel">--%>
                <%--<div class="panel-heading">--%>
                    <%--<h3 class="panel-title">快速链接</h3>--%>
                <%--</div>--%>
                <%--<div id='quickLinkBody' class="ui-jqgrid ui-corner-all">--%>

                <%--</div>--%>
            <%--</div>--%>
        <%--</div>--%>
    <%--</div>--%>


    <div class="row" style="margin-bottom:20px;">
        <div class="col-lg-4 col-sm-4 col-xs-12" id="todo_list" style="padding-right:30px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">个人待办事宜</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="todo_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="todo_list_row">
                    <table id="todo_table">
                    </table>
                </div>
            </div>
        </div>


        <div class="col-lg-4 col-sm-4 col-xs-12" id="norecord_list" style="padding-left:15px;padding-right:15px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">已办未结</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="norecord_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="norecord_list_row">
                    <table id="norecord_table">
                    </table>
                </div>
            </div>

        </div>

        <div class="col-lg-4 col-sm-4 col-xs-12" id="record_list" style="padding-left:30px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">已办已结</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a id="record_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="record_list_row">
                    <table id="record_table">
                    </table>
                </div>
            </div>
        </div>
    </div>

</div>
<script>

    $(function() {
        load_notice();
        load_remind();
        load_todo();
        load_norecord();
        load_record();
//        load_project();
        $('#page-content').on("click", '#notice_more', function () {
            loadURL("menu/com/noticeTest?viewtype=2", $('#content-container'));
        });
        $('#page-content').on("click", '#remind_more', function () {
            loadURL("menu/remind", $('#content-container'));
        });
        $('#page-content').on("click", '#todo_more', function () {
            loadURL("menu/toDo", $('#content-container'));
        });
        $('#page-content').on("click", '#norecord_more', function () {
            loadURL("menu/taskRecord?type=1", $('#content-container'));
        });
        $('#page-content').on("click", '#record_more', function () {
            loadURL("menu/taskRecord?type=2", $('#content-container'));
        });


        $("#histogramBody").css("width", $("#histogram").width() + "px");
        $("#stackingGraphBody").css("width", $("#stackingGraph").width() + "px");
    });





    //公告通知
    function load_notice(){
        jQuery("#notice_table").jqGrid({
            <%--url:'<%=path%>/com/nitice/list?viewtype=2',--%>
            url:'<%=path%>/main/remind/list',
            datatype: "json",
            colNames:['公告主题',"id"],
            colModel:[
                {name:'topic',index:'topic', width:200,search:false,sortable:false},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_notice_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_notice_table span.ui-jqgrid-title more').remove();
                $('#gview_notice_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");
            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#notice_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#notice_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#notice_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#notice_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                loadURL('<%=path%>/com/noticeTest/read?keyId='+rowId+'&viewtype=2&index=1', $('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
         //   caption : "公告通知",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#notice_table").jqGrid('setGridWidth', $("#notice_list_row").width());
        })
        jQuery("#notice_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //提醒事项
    function load_remind(){
        jQuery("#remind_table").jqGrid({
            url:'<%=path%>/main/remind/list',
            datatype: "json",
            colNames:['提醒内容',"id",'url'],
            colModel:[
                {name:'content',index:'content', width:200,search:false,sortable:false},
                {name:'id',index:'id',search:false,hidden:true,key:true},
                {name:'url',index:'url',search:false,hidden:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_remind_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_remind_table span.ui-jqgrid-title more').remove();
                $('#gview_remind_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");
            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#remind_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#remind_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
//                var rowId = $("#remind_table").jqGrid('getGridParam','selrow');
//                var rowDatas = $("#remind_table").jqGrid('getRowData', rowId);
//                if(rowId !="")
//                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "提醒事项",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#remind_table").jqGrid('setGridWidth', $("#remind_list_row").width());
        })
        jQuery("#remind_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //个人待办事项目
    function load_todo(){
        jQuery("#todo_table").jqGrid({
            url:'../main/taskRecord/toDoList',
            datatype: "json",
            colNames:['审核内容','所属模块','申请人','上一步操作人','时间','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:100,search:false,sortable:false},
                {name:'module',index:'module', width:60,search:false,sortable:false},
                {name:'creater',index:'creater', width:60,search:false,sortable:false},
                {name:'toUser',index:'toUser', width:80,search:false,sortable:false},
                {name:'time',index:'time', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'docId',index:'docId',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_todo_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_todo_table span.ui-jqgrid-title more').remove();
                $('#gview_todo_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#todo_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#todo_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
//                var rowId = $("#todo_table").jqGrid('getGridParam','selrow');
//                var rowDatas = $("#todo_table").jqGrid('getRowData', rowId);
//                if(rowId !="")
//                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "个人待办事项",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#todo_table").jqGrid('setGridWidth', $("#todo_list_row").width());
        })
        jQuery("#todo_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };


    //已办未结
    function load_norecord(){
        jQuery("#norecord_table").jqGrid({
            url:'<%=path%>/main/taskRecord/list?type=1',
            datatype: "json",
            colNames:['审核内容','所属模块','申请人','当前操作人','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:100,search:false,sortable:false},
                {name:'module',index:'module', width:60,search:false,sortable:false},
                {name:'creater',index:'creater', width:60,search:false,sortable:false},
                {name:'usernames',index:'usernames', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_norecord_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_norecord_table span.ui-jqgrid-title more').remove();
                $('#gview_norecord_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#norecord_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#norecord_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#norecord_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#norecord_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "已办未结",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#norecord_table").jqGrid('setGridWidth', $("#norecord_list_row").width());
        })
        jQuery("#norecord_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //已办已结
    function load_record(){
        jQuery("#record_table").jqGrid({
            url:'<%=path%>/main/taskRecord/list?type=2&index=1',
            datatype: "json",
            colNames:['审核内容','所属模块','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:200,search:false,sortable:false},
                {name:'module',index:'module', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_record_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_record_table span.ui-jqgrid-title more').remove();
                $('#gview_record_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#record_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#record_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#record_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#record_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
         //   caption : "已办已结",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#record_table").jqGrid('setGridWidth', $("#record_list_row").width());
        })
        jQuery("#record_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //日历
    $('#calendarBody').fullCalendar({
        theme: false,
        lang: 'zh-cn',
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaDay'
        },
        defaultDate: new Date(),
        editable: false,
        eventLimit: true, // allow "more" link when too many events
        events: {
            <%--url: '<%=path%>/manage/ajax-schedule!getCalendarJson.action',--%>
            <%--error: function() {--%>
                <%--//  $('#script-warning').show();--%>
            <%--}--%>
        },
        timeFormat: 'H:mm',
        eventClick: function(calEvent, jsEvent, view) {
//            if(calEvent.toName=="schedule"){
//                loadURL("../manage/ajax-schedule!read.action?keyId="+calEvent.id,$('#content'));
//            }else if(calEvent.toName=="meetingUse"){
//                loadURL("../manage/ajax-meetinguse!read.action?keyId="+calEvent.id+"&scheduleCalandar=1",$('#content'));
//            }

        },
        eventAfterRender: function(){

        },

        loading: function(bool) {
            //$('#loading').toggle(bool);
        }
    });

    <%--//实施中项目一览表--%>
    <%--function load_project(){--%>
        <%--jQuery("#project_table").jqGrid({--%>
            <%--url:'<%=path%>/com/noticeTest/projectList',--%>
            <%--datatype: "json",--%>
            <%--colNames:["项目编号",'工程名称',"工程类型","项目经理","当前阶段","id"],--%>
            <%--colModel:[--%>
                <%--{name:'projectNo',index:'projectNo', width:120,sortable:true,search:false, searchoptions: {sopt: ['cn']}},--%>
                <%--{name:'projectName',index:'projectName', width:120,search:false,sortable:true, searchoptions: {sopt: ['cn']}},--%>
                <%--{name:'projectType',index:'projectType',sortable:true,search:false,width:120, searchoptions: {sopt: ['cn']}},--%>
                <%--{name:'projectPerson',index:'projectPerson',sortable:true,search:false,width:100, searchoptions: {sopt: ['cn']}},--%>
                <%--{name:'step',index:'step', search:false,sortable:true,width:80, searchoptions: {sopt: ['cn']}},--%>
                <%--{name:'id',index:'id',search:false,hidden:true}--%>
            <%--],--%>
            <%--rowNum :10,--%>
            <%--// rowList:[10,20,30],--%>
            <%--//  pager : '#notice_list_page',--%>
            <%--sortname : '',--%>
            <%--sortorder : "",--%>
            <%--gridComplete:function(){--%>
                <%--$('#gview_project_table a.ui-jqgrid-titlebar-close').hide();--%>
                <%--$('#gview_project_table span.ui-jqgrid-title more').remove();--%>
                <%--$('#gview_project_table span.ui-jqgrid-title').append('<more>More</more>') ;--%>
                <%--$(".ui-jqgrid-bdiv").css("overflow-x","hidden");--%>

            <%--},--%>
            <%--onSelectRow: function (rowId, status, e) {--%>
                <%--var rowId = $("#project_table").jqGrid('getGridParam','selrow');--%>
                <%--var rowDatas = $("#project_table").jqGrid('getRowData', rowId);--%>
            <%--},--%>
            <%--ondblClickRow:function(rowid, iRow, iCol, e){--%>
<%--//                var rowId = $("#project_table").jqGrid('getGridParam','selrow');--%>
<%--//                var rowDatas = $("#project_table").jqGrid('getRowData', rowId);--%>
<%--//                if(rowId !="")--%>
<%--//                    loadURL(rowDatas.url+"&index=1",$('#page-content'));--%>
            <%--},--%>
            <%--jsonReader: {--%>
                <%--root: "dataRows",--%>
                <%--page: "page",--%>
                <%--total: "total",--%>
                <%--records: "records",--%>
                <%--repeatitems : false--%>
            <%--},--%>
            <%--multiselect : false,--%>
            <%--rownumbers:false,--%>
            <%--gridview:true,--%>
            <%--shrinkToFit:true,--%>
            <%--viewrecords: false,--%>
            <%--autowidth: true,--%>
            <%--height:'auto',--%>
            <%--forceFit:true,--%>
            <%--loadComplete: function() {--%>
            <%--}--%>
        <%--});--%>
        <%--$(window).on('resize.jqGrid', function() {--%>
            <%--jQuery("#project_table").jqGrid('setGridWidth', $("#project_list_row").width());--%>
        <%--})--%>
        <%--jQuery("#project_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});--%>
    <%--}--%>
</script>
